<template>
    <Modal title="教师评分" :value="value" @input="handleInput">
        <Table :data="data" :columns="columns">
            <template slot="field3" slot-scope="{ row,index }">
                <inputNumber v-model="data[index].teaScoreBefore" size="small"/>
            </template>
        </Table>
        <div slot="footer">
            <Button type="text" @click="cancel">取消</Button>
            <Button type="primary" @click="ok">确定</Button>
        </div>
    </Modal>
</template>
<script>
export default {
    props: {
        value: {
            default: false,
            type: Boolean
        },
        data: {
            default: () => [],
            type: Array
        }
    },
    data () {
        return {
            columns: [
                { title: '序号', type: 'index', align: 'center', width: 60 },
                { title: '学生姓名', key: 'realName' },
                { title: '学生学号', key: 'userNo' },
                { title: '教师打分（百分制）', slot: 'field3', width: 120 }
            ]
        }
    },
    created () {
        // this.queryList()
        console.log(this.data)
    },
    methods: {
        handleInput (v) {
            this.$emit('input', v)
        },
        ok (v) {
            this.$emit('ok', this.data)
            this.$emit('cancel', v)
        },
        cancel (v) {
            this.$emit('cancel', v)
        },
        queryList () {

        }
    }
}
</script>
